Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vaadin/media-query-mixin

Package Overview
Dependencies
Maintainers
16
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vaadin/media-query-mixin

This package provides `MediaQueryMixin` and `@mediaProperty` decorator.

  • 0.1.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
16
Weekly downloads
 
Created
Source

@vaadin/media-query-mixin

This package provides MediaQueryMixin and @mediaProperty decorator.

@customElement('mq-basic-element')
class MyElement extends MediaQueryMixin(LitElement) {
  @mediaProperty({ media: '(max-width: 420px)' })
  fullscreen: boolean | null | undefined;
}

Using a @mediaProperty decorator

When using @mediaProperty, the following restrictions apply:

  • property is forced to be of type: Boolean regardless of the user config
  • property value is set to true when query matches, and false otherwise
  • attribute: false is forced so setting attribute is ignored
  • property is read-only so manual modifications are ignored
  • default property value set by the user is also ignored

As a result, window.matchMedia is a single source of truth.

FAQs

Package last updated on 24 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc